1. Field of the Invention
The present invention relates to an image processing program and an image processing device and, more particularly, to an image processing program and an image processing device for detecting a collision between objects in a virtual three-dimensional space.
2. Description of the Background Art
Patent Document 1 (Japanese Laid-Open Patent Publication No. 7-230559) describes a conventional technique for performing a collision detection (also called “contact detection”) between objects in a video game where there are a plurality of objects (a player character, etc.) in a virtual three-dimensional space. This technique uses a plurality of spherical regions as regions defined for each object for the purpose of collision detection. Specifically, an image processing device described in Patent Document 1 defines a plurality of spherical regions in each object, and calculates the degree of overlap between spherical regions of different objects using the center coordinates and the radii of the spheres. If the degree of overlap is greater than a predetermined value, it is determined that the objects have contacted each other. Thus, a collision detection can be performed by approximating each object by a plurality of spheres. Then, the amount of memory required for the collision detection can be reduced as compared with a case where each object is approximated by a quadrangular prism, whereby it is possible to increase the process speed and the accuracy of the collision detection.
In this conventional technique, the degree of overlap between spheres in a three-dimensional space is calculated, thus requiring an operation using three-dimensional coordinate values, such as an operation of calculating the distance between two points in a three-dimensional space. Therefore, with regard to the processing speed, it can be said that there still is a large processing load on the computer.